package com.xoa.controller.party;


import com.xoa.model.party.EsGroupControl;
import com.xoa.service.party.EsGroupControlService;
import com.xoa.util.ToJson;
import com.xoa.util.common.newwrapper.BaseWrapper;
import com.xoa.util.common.wrapper.BaseWrappers;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 群防群治布控点位
 * Created by gsb on 2018/1/11.
 */
@Controller
@RequestMapping("/esGroupControl")
public class EsGroupControlController {

    @Resource
    private EsGroupControlService esGroupControlService;

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午15:32:51
     * 类介绍  :   新建
     * 构造参数:
     *
     */
    @RequestMapping(value ="insertSelective")
    @ResponseBody
    public ToJson<EsGroupControl> insertSelective(EsGroupControl esGroupControl , HttpServletRequest request, String gridLocation){
        return esGroupControlService.insertSelective(esGroupControl, request,gridLocation);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午15:32:51
     * 类介绍  :   删除
     * 构造参数:
     *
     */
    @RequestMapping(value ="deleteByPrimaryKey")
    @ResponseBody
    public ToJson<EsGroupControl> deleteByPrimaryKey(Integer tid){
        return esGroupControlService.deleteByPrimaryKey(tid);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午15:32:51
     * 类介绍  :   修改
     * 构造参数:
     *
     */
    @RequestMapping(value ="updateByPrimaryKeySelective")
    @ResponseBody
    public ToJson<EsGroupControl> updateByPrimaryKeySelective(EsGroupControl esGroupControl, String gridLocation){
        return esGroupControlService.updateByPrimaryKeySelective(esGroupControl,gridLocation);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午15:32:51
     * 类介绍  :   详情
     * 构造参数:
     *
     */
    @RequestMapping(value ="selectById")
    @ResponseBody
    public ToJson<EsGroupControl> selectById(Integer tid){
        return esGroupControlService.selectById(tid);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午15:32:51
     * 类介绍  :   列表
     * 构造参数:
     *
     */
    @RequestMapping(value ="queryList")
    @ResponseBody
    public ToJson<EsGroupControl> queryList(EsGroupControl esGroupControl, Integer page, Integer pageSize,
                                            boolean useFlag, HttpServletRequest request, HttpServletResponse response, String export){
        return esGroupControlService.queryList(esGroupControl, page, pageSize, useFlag, request, response, export);
    }

    @RequestMapping("/outPutFile")
    @ResponseBody
    public BaseWrapper outPutFile(HttpServletRequest request, HttpServletResponse response){
        return esGroupControlService.outPutFile(request,response);
    }

    /**
     * 郭心雨
     * 根据坐标分页获取
     * @param page
     * @param pageSize
     * @param useFlag
     * @param gridLocation
     * @return
     */
    @RequestMapping(value ="queryListByLoc")
    @ResponseBody
    public BaseWrappers queryListByLoc(Integer page, Integer pageSize, boolean useFlag, String gridLocation){
        return esGroupControlService.queryListByLoc( page,  pageSize, useFlag,  gridLocation);
    }
}
